/*
using MyGeneration/Template/NHibernate (c) by Sharp 1.4
based on OHM (alvy77@hotmail.com)
*/
using System;
using System.Collections;
using System.Collections.Generic;

namespace DomainModel
{

	/// <summary>
	/// ILibraryBookIndentDetail interface for NHibernate mapped table 'LibraryBookIndentDetail'.
	/// </summary>
	public interface ILibraryBookIndentDetail
	{
		#region Public Properties
		
		int lbid_id
		{
			get ;
			set ;
			  
		}
		
		int lbid_lbiid
		{
			get ;
			set ;
			  
		}
		
		int lbid_lbdid
		{
			get ;
			set ;
			  
		}
		
		string lbi_appraisal
		{
			get ;
			set ;
			  
		}
		
		byte lbi_recommend
		{
			get ;
			set ;
			  
		}
		
		bool IsDeleted { get; set; }
		bool IsChanged { get; set; }
		
		#endregion 
	}

	/// <summary>
	/// LibraryBookIndentDetail object for NHibernate mapped table 'LibraryBookIndentDetail'.
	/// </summary>
	[Serializable]
	public class LibraryBookIndentDetail : ICloneable,ILibraryBookIndentDetail
	{
		#region Member Variables

		protected int _lbid_id;
		protected int _lbid_lbiid;
		protected int _lbid_lbdid;
		protected string _lbi_appraisal;
		protected byte _lbi_recommend;
		protected bool _bIsDeleted;
		protected bool _bIsChanged;
		#endregion
		
		#region Constructors
		public LibraryBookIndentDetail() {}
		
		public LibraryBookIndentDetail(int plbidlbiid, int plbidlbdid, string plbiappraisal, byte plbirecommend)
		{
			this._lbid_lbiid = plbidlbiid; 
			this._lbid_lbdid = plbidlbdid; 
			this._lbi_appraisal = plbiappraisal; 
			this._lbi_recommend = plbirecommend; 
		}
		
		public LibraryBookIndentDetail(int plbidlbiid, int plbidlbdid, byte plbirecommend)
		{
			this._lbid_lbiid = plbidlbiid; 
			this._lbid_lbdid = plbidlbdid; 
			this._lbi_recommend = plbirecommend; 
		}
		
		public LibraryBookIndentDetail(int plbidid)
		{
			this._lbid_id = plbidid; 
		}
		
		#endregion
		
		#region Public Properties
		
		public virtual int lbid_id
		{
			get { return _lbid_id; }
			set { _bIsChanged |= (_lbid_id != value); _lbid_id = value; }
			
		}
		
		public virtual int lbid_lbiid
		{
			get { return _lbid_lbiid; }
			set { _bIsChanged |= (_lbid_lbiid != value); _lbid_lbiid = value; }
			
		}
		
		public virtual int lbid_lbdid
		{
			get { return _lbid_lbdid; }
			set { _bIsChanged |= (_lbid_lbdid != value); _lbid_lbdid = value; }
			
		}
		
		public virtual string lbi_appraisal
		{
			get { return _lbi_appraisal; }
			set 
			{
			  if (value != null && value.Length > 2147483647)
			    throw new ArgumentOutOfRangeException("lbi_appraisal", "lbi_appraisal value, cannot contain more than 2147483647 characters");
			  _bIsChanged |= (_lbi_appraisal != value); 
			  _lbi_appraisal = value; 
			}
			
		}
		
		public virtual byte lbi_recommend
		{
			get { return _lbi_recommend; }
			set { _bIsChanged |= (_lbi_recommend != value); _lbi_recommend = value; }
			
		}
		

		public virtual bool IsDeleted
		{
			get
			{
				return _bIsDeleted;
			}
			set
			{
				_bIsDeleted = value;
			}
		}
		
		public virtual bool IsChanged
		{
			get
			{
				return _bIsChanged;
			}
			set
			{
				_bIsChanged = value;
			}
		}
		
		#endregion 
		
		#region Equals And HashCode Overrides
		/// <summary>
		/// local implementation of Equals based on unique value members
		/// </summary>
		public override bool Equals( object obj )
		{
			if( this == obj ) return true;
			LibraryBookIndentDetail castObj = null;
			try
			{
				castObj = (LibraryBookIndentDetail)obj;
			} catch(Exception) { return false; } 
			return ( castObj != null ) &&
				( this._lbid_id == castObj.lbid_id );
		}
		/// <summary>
		/// local implementation of GetHashCode based on unique value members
		/// </summary>
		public override int GetHashCode()
		{
		  
			
			int hash = 57; 
			hash = 27 * hash * _lbid_id.GetHashCode();
			return hash; 
		}
		#endregion
		
		#region ICloneable methods
		
		public virtual object Clone()
		{
			return this.MemberwiseClone();
		}
		
		#endregion
	}
	
	#region Custom ICollection interface for LibraryBookIndentDetail 

	
	public interface ILibraryBookIndentDetailCollection : ICollection
	{
		LibraryBookIndentDetail this[int index]{	get; set; }
		void Add(LibraryBookIndentDetail pLibraryBookIndentDetail);
		void Clear();
	}
	
	[Serializable]
	public class LibraryBookIndentDetailCollection : ILibraryBookIndentDetailCollection
	{
		private IList<LibraryBookIndentDetail> _arrayInternal;

		public LibraryBookIndentDetailCollection()
		{
			_arrayInternal = new List<LibraryBookIndentDetail>();
		}
		
		public LibraryBookIndentDetailCollection( IList<LibraryBookIndentDetail> pSource )
		{
			_arrayInternal = pSource;
			if(_arrayInternal == null)
			{
				_arrayInternal = new List<LibraryBookIndentDetail>();
			}
		}

		public LibraryBookIndentDetail this[int index]
		{
			get
			{
				return _arrayInternal[index];
			}
			set
			{
				_arrayInternal[index] = value;
			}
		}

		public int Count { get { return _arrayInternal.Count; } }
		public bool IsSynchronized { get { return false; } }
		public object SyncRoot { get { return _arrayInternal; } }
		public void CopyTo(Array array, int index){ _arrayInternal.CopyTo((LibraryBookIndentDetail[])array, index); }
		public IEnumerator GetEnumerator() { return _arrayInternal.GetEnumerator(); }
		public void Add(LibraryBookIndentDetail pLibraryBookIndentDetail) { _arrayInternal.Add(pLibraryBookIndentDetail); }
		public void Clear() { _arrayInternal.Clear(); }
		public IList<LibraryBookIndentDetail> GetList() { return _arrayInternal; }
	 }
	
	#endregion
}
